from typing import Any, Dict, List, Optional, Union

class ResponseFactory:
    @staticmethod
    def success(data: Any = None, message: str = "成功！") -> Dict[str, Any]:
        """生成成功响应"""
        return {
            "code": 0,
            "message": message,
            "data": data
        }
    
    @staticmethod
    def error(code: int = 500, message: str = "操作失败") -> Dict[str, Any]:
        """生成错误响应"""
        return {
            "code": code,
            "message": message,
            "data": None
        } 